package com.spboot.page;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

/**
 * 扩展分页插件
 * 
 * @author Administrator
 *
 * @param <T>
 */
public class PageInfo<T> extends Page<T> {

	public PageInfo() {
		super();
	}

	public PageInfo(long current, long size) {
		super(current, size);
	}

	//总页数
	public long getPages() {
		if (getSize() == 0L) {
			return 0L;
		}
		long pages = getTotal() / getSize();
		if (getTotal() % getSize() != 0L) {
			pages += 1L;
		}
		return pages;
	}
}
